Skip to content

changes in APC handling#5840

Open
jerch wants to merge 15 commits intomasterfrom
fix_apc
Open

changes in APC handling#5840
jerch wants to merge 15 commits intomasterfrom
fix_apc

Conversation

@jerch
Copy link
Copy Markdown
Member

@jerch jerch commented Apr 24, 2026

TODO:

  • change register interface to IFunctionIdentifier (API change)
  • extend parser states with APC_ENTRY, APC_INTERMEDIATE, APC_PASSTHROUGH
  • rework ApcParser
  • fix actions APC_START and APC_PUT
  • tests:
    • parser transition tests for new APC states (test against ECMA-48 and DEC spec)
    • parser tests for APC registration
    • async handler tests
    • rework ApcParser tests
  • APC_PUT read ahead optimization
  • APC perf tests
  • Update xterm.js docs page --> add APC docs xtermjs.org#224

Fixes #5834.

- change interface to IFunctionIdentifier (API change)
- extend parser states APC_ENTRY, APC_INTERMEDIATE, APC_PASSTHROUGH
- remove APC_STRING
- change ApcParser.start to retrieve ident
- change actions APC_START and APC_PUT
@jerch jerch added breaking-change Breaks API and requires a major version bump area/performance area/api area/parser labels Apr 24, 2026
@jerch jerch added this to the 7.0.0 milestone Apr 24, 2026
@jerch
Copy link
Copy Markdown
Member Author

jerch commented Apr 24, 2026

@anthonykim1 This branch changes several aspects of the internal APC handling on the parser (better spec conformance, for details see #5834 (comment)). If you have a test battery for the kitty graphics protocol, please test it against this branch.

@jerch jerch requested review from Tyriar and anthonykim1 April 25, 2026 13:58
@jerch
Copy link
Copy Markdown
Member Author

jerch commented Apr 26, 2026

Note on ApcParser:

The ApcParser is now a copy clone of DcsParser minus params handling. Before it was a copy clone of OcsParser. The change was needed to correctly reflect the possibility of intermediates in the function identifier.

In theory this would allow to merge ApcParser & DcsParser into one base sub parser class with method signature overloads. I did not do that yet, as APC is a bit wonky on the spec side of things (see #5834) with almost no prior art to learn from beside thin layout hints in ECMA-48 and by DEC. (If I remember right, some mainframe terminals used APC in the past, but I have no docs about those either.)

By keeping the parsers separate for now we have a better chance to correct mistakes individually for APC.

Copy link
Copy Markdown
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthonykim1 could you have a look over this? I'm assuming any major problems with kitty image would reveal themselves from this change due to ImageAddon.test.ts?

If you have a test battery for the kitty graphics protocol, please test it against this branch.

There's this tool I was experimenting with to make these newer features easier to manually test https://github.com/xtermjs/vtc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APC parser tests & benchmark missing

2 participants